<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">  <meta name="description" content="">
  <meta name="author" content="">

  <title>防绿帽系统注册</title>
  <link rel="stylesheet" rel="/stylesheet/index.css">
  <script type="text/javascript" src="/javascripts/jquery-3.3.1.js"></script>
  <script type="text/javascript" src="/javascripts/jquery.cookie.js"></script>
  <link href="/bootstrap-4.0.0-dist/css/bootstrap.min.css" rel="stylesheet">
  <script type="text/javascript" src="/bootstrap-4.0.0-dist/js/bootstrap.js"></script>
  <script type="text/javascript" src="/javascripts/login.js"></script>
  <script type="text/javascript">
      //检验token是否存在与合法
      if($.cookie('userToken')){
          //token存在
          console.log('token存在')
      }else {
          //token不存在
          window.location.href='/login'
      }

      $('#registerBtn').click(function () {

          window.location.href='/register'
      });
  </script>
</head>

<body class="text-center">

<header class="blog-header py-3 box-shadow border-bottom box-shadow">
  <div class="row justify-content-end align-items-center">
    <div class="align-items-center pr-3">
      <a id="nameText" class="p-2 text-muted" href="#"></a>
      <a id="myFollow" class="p-2 text-muted" href="#">我的跟踪</a>
      <a id="explain" class="p-2 text-muted" href="#">使用说明</a>
      <a id="logoutBtn" class="p-2 text-muted" href="#">退出登录</a>
    </div>
  </div>
</header>

<img class="pt-2 mb-2 " src="/images/logo.png" alt="" width="100" height="100">
<!--<img class="pt-2 mb-2" src="https://nogreenhat.oss-cn-hangzhou.aliyuncs.com/logo%401.5x.png">-->
<h2 class="my-2 mr-md-auto font-weight-bold text-center text-dark">欢迎来到防绿帽系统</h2>


<div class="container">
  <div class="panel panel-default rounded mt-4 mb-2" style="background-color: rgb(220,220,220)">
    <div class="panel-heading p-1">
      <input id="traceNameText" type="text" class="form-control" placeholder="请输入要跟踪人的称呼" style="font-size: 15px">
    </div>
  </div>

  <div class="mb-3">
    <div class="card mb-4 box-shadow">
      <div class="row justify-content-start align-items-center mt-3">
        <img class="mx-4" style=" border-radius: 60%" src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=631020498,1595757258&fm=27&gp=0.jpg" width="60" height="60" >
          <small class="text-muted mx-2">滴滴红包,快来领取!</small>
      </div>

      <div class="mt-3 pb-3 row justify-content-center mx-4">
        <a href="#" data-type="readArticle" data-value="0" class="btn btn-success mr-5">预览文章</a>
        <a href="#" data-type="createArticle" data-value="0" class="btn btn-success">生成文章</a>
      </div>
    </div>

    <div class="card mb-4 box-shadow">
      <div class="row justify-content-start align-items-center mt-3">
        <img class="mx-4" style=" border-radius: 60%" src="https://m.360buyimg.com/n12/jfs/t3307/264/6175337512/789433/e9949b84/58a1db4bN9a45c15e.jpg!q70.jpg" width="60" height="60" >
        <small class="text-muted mx-2">老公,帮我看下这条裙好不好看？</small>
      </div>

      <div class="mt-3 pb-3 row justify-content-center mx-4">
        <a href="#" data-type="readArticle" data-value="1" class="btn btn-success mr-5">预览文章</a>
        <a href="#" data-type="createArticle" data-value="1" class="btn btn-success">生成文章</a>
      </div>
    </div>


    <div class="card mb-4 box-shadow">
      <div class="row justify-content-start align-items-center mt-3">
        <img class="mx-4" style=" border-radius: 60%" src="https://img10.360buyimg.com/n1/jfs/t22357/67/931492897/269411/edf7317d/5b1c90f0N2546d831.jpg" width="60" height="60" >
        <small class="text-muted mx-2">老婆，帮我看下这双鞋帅不帅？</small>
      </div>

      <div class="mt-3 pb-3 row justify-content-center mx-4">
        <a href="#" data-type="readArticle" data-value="2" class="btn btn-success mr-5">预览文章</a>
        <a href="#"  data-type="createArticle" data-value="2" class="btn btn-success">生成文章</a>
      </div>
    </div>
  </div>

  <button type="button" class="btn btn-info mb-4" id="customArticle">自定义文章</button>

  <footer class="pt-4 pb-5 border-top">
    <a class="my-2 font-weight-normal text-center text-danger" style="font-size: 12px">声明: 本系统仅限用于各位社友"防偷情，防出轨"，促进社会和谐发展，不可用于违法犯罪之事.</a>
    <small class="d-block pt-4 mb-3 text-muted text-center">© Wbqqqq</small>
  </footer>
</div>

<div class="modal fade" data-toggle="modal" data-target="#identifier" id="identifier" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                请输入要跟踪人的称呼
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">确认</button>
            </div>
        </div>
    </div>

</div>

<div class="modal fade" data-toggle="modal" data-target="#identifier1" id="identifier1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body text-center">
                <p class="small"> 1.输入要侦查对象的名字。</p>
                <p class="small"> 2.通过手机微信或qq等手段将链接发送给侦查的对象。</p>
                <p class="small"> 3.在我的跟踪界面查看结果。</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">确认</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" data-toggle="modal" data-target="#identifier2" id="identifier2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body text-center">
                <p class="small"> 觉得文章可信度很低？</p>
                <p class="small"> 想自定义文章提高成功率，请联系作者 </p>
                <p class="small"> 微信: wangbingquan002</p>
                <p class="small"> qq:353351363</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">确认</button>
            </div>
        </div>
    </div>
</div>


</body>
</html>


<script type="text/javascript">

    var token = $.cookie('userToken')

    $('#logoutBtn').click(function () {
        $.cookie("userToken", "", {expires: -1});
        window.location.href='/login'
    });

    $('a[data-type="readArticle"]').click(function(){
        switch ($(this).attr("data-value")){
            case "0":
                window.location.href='/didi'
                break;
            case "1":
                window.location.href='/skirt'
                break;
            case "2":
                window.location.href='/shoes'
                break;
            default :
                break
        }

    });


    $('a[data-type="createArticle"]').click(function(){

        let name =  $.trim($('#traceNameText').val())
        if(!name.length){
            $('#identifier').modal()
            return
        }

        switch ($(this).attr("data-value")){
            case "0":
                window.location.href='/didi?token='+ token +'&&name=' + name
                break;
            case "1":
                window.location.href='/skirt?token='+ token +'&&name=' + name
                break;
            case "2":
                window.location.href='/shoes?token='+ token +'&&name=' + name
                break;
            default :
                break
        }
    });

    $('#explain').click(function () {
        $('#identifier1').modal()
    });

    $('#myFollow').click(function () {
        window.location.href='/myfollow'
    });

    $('#customArticle').click(function () {
        $('#identifier2').modal()
    });


    getUserInfo((res)=>{
        console.log(res.data.userName)
        $("#nameText").text(res.data.userName);
    })

</script>





